#include <iostream>
#include <cstring>
using namespace std;

class Person
{
protected:
  char Name[10];
  char Sex;
  int Age;

public:
  void Register(char *name, int age, char sex)
  {
    strcpy(Name, name);
    Age = age;
    Sex = sex;
  }

  void ShowMe()
  {
    cout << "姓名 " << Name << endl;
    cout << "性别" << Sex << endl;
    cout << "年龄" << Age << endl;
  }
};

class Teacher : public Person
{
private:
  char Dept[20];
  int Salary;

public:
  Teacher(char *name, int age, char sex, char *Dept, int Salary)
  {
    Register(name, age, sex);
    strcpy(this->Dept, Dept);
    this->Salary = Salary;
  }

  void ShowMe()
  {
    Teacher::ShowMe();
    cout << "工作单位 " << Dept << endl;
    cout << "月薪 " << Salary << endl;
  }
};

class Student : public Person
{
private:
  char ID[12];
  char CLass[12];

public:
  Student(char *name, int age, char sex, char *id, char *classid)
  {
    Register(name, age, sex);
    strcpy(ID, id);
    strcpy(CLass, classid);
    
  }
  void ShowMe()
  {
    cout << "学号 " << ID << endl;
    Person::ShowMe();
    cout << "班级 " << CLass << endl;
  }
};

int main()
{
  char name[10];
  int age;
  char sex;
  char Dept[10] ;
  int Salary;
  cin >> name >> age >> sex >> Dept >> Salary;
  Teacher t(name, age, sex, Dept, Salary);
  char ID[12];
  char CLass[12];
  cin >> name >> age >> sex >> ID >> CLass;
  Student s(name, age, sex, ID, CLass);
  return 0;
}